import Mock from 'mockjs'

const data = Mock.mock({
  'items|30': [{
    id: '@id',
    order: '@id',
    'status|1': ['未完成', '已完成'],
    'statusa|1': ['正常', '空闲', '故障'],
    'statusb|1': ['等待', '正在运行', '已完成', '故障'],
    'statusc|1': ['未领取', '准备中', '已领取'],
    x: '1',
    h: '1',
    num: '5',
    equipmentProcess: 'name',
    starTime: '@datetime',
    endTime: '@datetime',
    userName: '@sentence(10, 20)',
    pageviews: '@integer(300, 5000)'
  }]
})

export default [
  {
    url: '/order/list',
    type: 'get',
    response: config => {
      const items = data.items
      return {
        code: 200, success: true, message: '操作成功！',
        data: {
          pageData: {
            total: 30,
            currentPage: 1,
            totalPage: 1,
            hasNaxtPage: true
          },
          list: items
        }
      }
    }
  },
  {
    url: '/materials/list',
    type: 'get',
    response: config => {
      const items = data.items
      return {
        code: 200, success: true, message: '操作成功！',
        data: {
          pageData: {
            total: 30,
            currentPage: 1,
            totalPage: 1,
            hasNaxtPage: true
          },
          list: items
        }
      }
    }
  },
  {
    url: '/initDevice/list',
    type: 'get',
    response: config => {
      const items = data.items
      return {
        code: 200, success: true, message: '操作成功！',
        data: {
          pageData: {
            total: 30,
            currentPage: 1,
            totalPage: 1,
            hasNaxtPage: true
          },
          list: items
        }
      }
    }
  }
]
